#ifndef ENGINE_H
#define ENGINE_H

#include <SDL.h>
#include "Texture.h"

//! Engine class that runs the game.
/*!
 The class engine loads the data and runs the game.
*/
class CEngine
{
private:

	//! Boolean indicating if the engine is running.
	bool m_running;

	//! Data representing the screen.
	SDL_Surface* m_screen;

	//! Screen width.
	int m_screenWidth;

	//! Screen height.
	int m_screenHeight;

	//! Screen depth
	int m_screenDepth;

	//! Current fps
	long m_fps;

	//! Time elapsed since the last fps calculation
	long m_fpsTicks;

	//! Data used to calculate the fps
	long m_fpsCounter;

	//! Last update timer
	long m_lastTick;


public:
	//! Constructor.
	CEngine(void);

	//! Destructor
	~CEngine(void);

	//! Initialise the engine.
	/*! Initialise the engine and every component of the engine.*/
	void init(void);

	//! Load the level.
	/*! Load all the data*/
	void load(void);

	//! Start the game.
	/*! Start the engine and the game loop*/
	void start(void);

	//! Function to render the next frame.
	/*! Function called at the end of the game loop to render the next frame. It calls the pre render function from the
	Visualisation component, the render function from the World component and the post render from the Visualisation*/
	void doRender(void);

	//!Quit the game
	/*!Quit the game deleting all the components.*/
	void quit(void);

};

#endif
